//
//  KKMessageItem.h
//  ReplyAssistant
//
//  Created by liaozhenming on 2018/11/22.
//  Copyright © 2018 KK. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import "RAMessage.h"
#import "KKChatMsgBaseTableViewCell.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, KKMessageType) {
    KKMessageType_UnKnown = 0,      /**<未知消息类型*/
    KKMessageType_Text = 1,         /**<文本*/
    KKMessageType_Image = 2,        /**<图片*/
    KKMessageType_TimeTip = 3,      /**<时间提醒标签，不存在于IMSDK缓存的数据库中，业务动态生成*/
};

typedef NS_ENUM(NSUInteger, KKMessageStatus) {
    KKMessageStatus_Init = -1,
    KKMessageStatus_WillSending = 0,
    KKMessageStatus_Sending = 1,
    KKMessageStatus_SendSuccess = 2,
    KKMessageStatus_SendFail = 3,
};

#pragma mark - KKMessageItem Class
@interface KKMessageItem : NSObject
@property (nonatomic, strong) RAMessage *msg;
@property (nonatomic, assign) KKMessageType type;
@property (nonatomic, assign) KKMessageStatus status;

//  初始化时间消息
+ (instancetype)msgWithDate:(NSDate*)timetips;


+ (instancetype)msgWithTMessage:(RAMessage*)msg;

//  是否为自己的消息
- (BOOL)isMineMsg;
@end


#pragma mark - KKMessageItem(UITableViewCell) Class
@interface KKMessageItem(UITableViewCell)

@property (nonatomic, assign) CGFloat cellHeight;
@property (nonatomic, assign) CGSize cellContentSize;

//  获取cell
- (KKChatMsgBaseTableViewCell*)tableView:(UITableView *)tableView style:(KKChatMsgBaseTableViewCellStyle)style;

//  获取cell的高度
- (CGFloat)heightInWidth:(CGFloat)width style:(KKChatMsgBaseTableViewCellStyle)style;

// 只算内容的size
- (CGSize)contentSizeInWidth:(CGFloat)width;

@end


NS_ASSUME_NONNULL_END
